﻿//Turn Console Logging On/Off for framework events
ME_CONSOLE_LOG = false;

//Add custom event handlers.  You may delete the ones you don't use
ME_Client.AddEventHandler('ME5.SDK.TestTheme', function () {
    return {
        init: function() {
            //This function is fired after the ME object is loaded
            ME.Navigation.loader_img = "/_layouts/15/images/EntreeServer/inc/ajax-loader.gif"; //Set a custom loading animation
        },
        resize: function() {
            //This function is fired when an orientation change takes place causing the screen to resize. 
        },
        beforeClick: function(elementRef, submitFormData) {
            //Summary: This function is fired when an element wtih a ClickAction is clicked, before processing the ClickAction.  Resolve the Deferred object optinonally with an updated ClickAction object as the first parameter and a Boolean value indicating if form data will be submitted as the second.  To prevent the click, reject the Deferred.
        },
        beforePanelRendered: function(panel, screenDefinition, animationStyle) {
            //This function is fired before a Panel renders a new or updated screen.  Resolve the Deferred objected optionally with first parameter of a screen definition object and second parameter of animation style.  Reject the Deferred to prevent the new screen from rendering.
        },
        afterPanelRendered: function(panel) {
            //This function is fired after a Panel has rendered a new or updated screen.
        },
        afterContextMenuClosed: function() {
            //This function is called after the Context Menu is closed
        },
        afterAppLoaded: function(appDefinition) {
            //This function is fired after an application is instantiated from it's JSON reprentation.
        },
        beforeAppSync: function(appDefinition) {
            //This function is fired before an application's data is pushed to the server. Resolve the Deferred object with an updated AppDefinition object to make changes.  Reject the Deferred to prevent the sync operation.
        },
        afterAppSync: function(appDefinition) {
            //This function is fired after an application sync has been completed.
        },
        beforeAppUpdate: function(appDefinition, syncData) {
            //This function is fired before an application's data is pushed to the server, even if not performing sync. Resolve the Deferred object optionally with an updated AppDefinition object as the first parameter and a Boolean value indication if data sync should ocurr as the second . Reject the Deferred to prevent the update operation.
        },
        afterAppUpdate: function(appObj) {
            //This function is fired after an application is update via a sync or installation update.
        }
    };
});